import Vue from "vue";
import App from "./App.vue";
import store from "./store";
import "./plugins/element.js";
import router from "./router";

//导入全局样式表
import './assets/css/global.css'

//导入字体图标
import './assets/fonts/iconfont.css'

//配置axios
import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
axios.interceptors.request.use(config => {
  var token = sessionStorage.getItem('token')
  console.log(token)
  config.headers.Authorization = window.sessionStorage.getItem('token')
  console.log(config)
  //在最后必须return config, config为请求对象
  return config
})
Vue.prototype.$http = axios

Vue.config.productionTip = false;

new Vue({
  store,
  router,
  render: h => h(App)
}).$mount("#app");
